package cn.zqh.mybatis.config;

import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
  * @Author: zqh
  * @Date:
  * @Description: mybatis的逻辑删除组件
*/
// 扫描我们的 mapper 文件夹
@MapperScan(basePackages = {"cn.zqh.commodity.mapper","cn.alm.pbs.api.articleServe.mapper","cn.alm.pbs.api.otherServe.mapper"})
@EnableTransactionManagement
@Configuration // 配置类
public class MyISqlInjectorConfig {


    // 逻辑删除组件！
    @Bean
    public ISqlInjector sqlInjector() {
        return new LogicSqlInjector();
    }

}
